<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.11.0.min.js"></script>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<title>Insert title here</title>

<script type="text/javascript" src="${pageContext.request.contextPath }/js/flowersingle.js"></script>
<link href="${pageContext.request.contextPath }/css/flowersingle.css" rel="stylesheet" type="text/css" />

<!-- 点击购物车开始 -->
<script type="text/javascript">
$(function(){
	$(".cartbutton").click(function(){
		$.ajax({
            url:"${pageContext.request.contextPath}/AddToCartServlet",
            async:false,
            type:"post",
            data:{'flowerID':"${flower.flowerID}",'buyNum':$(".num").val()},
            dataType:"json",
            success:function(d){
				
            }
        });
            alert("添加成功");
	})
})

</script>
<!-- 点击购物车结束 -->

<style type="text/css">
.top1 div{
border:0px !important;
}
</style>
</head>
<body>



<script type="text/javascript">
//<!-- 没有登录则无法点击加入购物车 -->

$(function(){
	if("${user}" == ""){
		$(".cartbutton").attr("disabled","disabled");
	}
})
</script>

<!-- 最上面的框 -->
<div class = "top1" style = "width:100%;height:40px;background-color: green;float: left;">
		<div class = "word33" style = "float:left;width:400px;font-size: 25px;color:white;font-weight: blod;">
			&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
			&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp✍花卉交易
		</div>
		<div class = "userinfo" style = "margin-left: 600px;width:200px;float: left;">
			<div class = "head" style = "margin-top:2px;width:35px;height: 35px;border-radius:40px;background-color: white;">
				<img alt="" src="${user.path }" style="width:100%;height: 100%;border-radius:40px;">
			</div>
			<div class = "username" style = "color:white;margin-top:2px;width:150px;height: 40px;line-height: 40px;margin-left: 5px;">
				${user.userName }
			</div>
		</div>
		
	</div>



<div class = "main">
	<div class = "top">
		<span style =  "color:#f4c257">★</span>
			花卉下单
	</div>
	<div class = "showdiv">
		<div class = "flowerpic" style = "">
			<img alt="" src="${flower.path }">
		</div>
	</div>
	<div class = "name">
		花卉名称:${flower.flowerName }
	</div>
	<div class = "price">
		价格：${flower.flowerPrice }￥
	</div>
	
	<div class = "buttondiv">
		<div class = "buttondiv1">
			<input type = "button" class = "b1" value = "-" style = "font-weight:bold;width:30px;height:30px;border-radius:40px;font-size: 20px;background-color: #defae5;color:green;">
			<input type = "text" value = "1" class = "num" style = "width:50px;font-size: 20px;">
			<input type = "button" class = "b2" value = "+" style = "font-weight:bold;width:30px;height:30px;border-radius:40px;font-size: 20px;background-color: #defae5;color:green;">
		</div>
		<div class = "buttondiv2">
			<input type = "button" class = "cartbutton" value = "加入购物车" style = "font-weight:bold;border-radius:10px;margin-top:20px;width:200px;height:50px;font-size: 20px;background-color: #defae5;color:green;">
		</div>
	</div>
	<div class = "say">
		商品介绍：
		<div class = "wordd" style = "width:95%;margin: 10px;height:100px;">
		${flower.flowerSay }
		</div>
	</div>
</div>




</body>
</html>